package some.coupon.admin.dao;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import some.coupon.admin.domain.ACouponCommand;


@Component
public class ACouponDaoImpl extends SqlSessionDaoSupport implements ACouponDao{

	@Override
	public List<ACouponCommand> aCouList() {
		List<ACouponCommand> list = getSqlSession().selectList("AdminCouponDao.getList");
		return list;
	}
	@Override
	public List<ACouponCommand> saleACouList() {
		List<ACouponCommand> list = getSqlSession().selectList("AdminCouponDao.getSaleList");
		return list;
	}
	@Override
	public ACouponCommand aCouDetail(String cou_id) {
		return getSqlSession().selectOne("AdminCouponDao.getDetail", cou_id);
	}
	@Override
	public int aCouNeedPoint(String cou_id) {
		return getSqlSession().selectOne("AdminCouponDao.getPoint", cou_id);
	}
	@Override
	public void updateACou(ACouponCommand aCouponCommand) {
		getSqlSession().update("AdminCouponDao.updateACou", aCouponCommand);
	}
	@Override
	public void insertACou(ACouponCommand aCouponCommand) {
		getSqlSession().insert("AdminCouponDao.insertACou", aCouponCommand);
		
	}
	@Override
	public void setShow(String cou_id) {
		getSqlSession().update("AdminCouponDao.setShow", cou_id);
	}
	@Override
	public void setHiding(String cou_id) {
		getSqlSession().update("AdminCouponDao.setHiding", cou_id);
	}
	@Override
	public int checkCou_id(String cou_id) {
		return getSqlSession().selectOne("AdminCouponDao.checkCou_id", cou_id);
	}

}
